if(is_page(450)){
	/*
		Categorias con su codigo de categoria:
		Bolsa:3
		Protocolo:5
		Marketing:7
		Liderazgo:6
	*/
	$categorias = array(6,7,3,5);
	$ahora= time();
	$anno = date("Y",$ahora);
	if(date("m", $ahora) < 6){
		$fechaActual = date("Y", $ahora)-1 . '/'. date("Y", $ahora);
	}
	else{
		$fechaActual = date("Y", $ahora) . '/'. date("Y", $ahora)+1;
	}
	foreach($categorias as $categoria){
		require_once 'cursos/configuracion.php';
		$cursos = $cn->query("SELECT  post_title, post_content, guid,post_date
								FROM  wp_posts JOIN wp_term_relationships on object_id=ID
								WHERE post_title NOT LIKE  '%Borrador%' and post_status like 'publish' and term_taxonomy_id=".$categoria."
								GROUP BY  post_title 
								ORDER BY  ID DESC 
									LIMIT 1");
		foreach($cursos as $curso){
			$phpdate = strtotime($curso['post_date']);
			if(date("m", $phpdate) < 6){
				$fechaCurso = date("Y", $phpdate)-1 . '/'. date("Y", $phpdate);
			}
			else{
				$fechaCurso = date("Y", $phpdate) . '/'. date("Y", $phpdate)+1;
			}
			switch($categoria){
				case 3:if (strcmp($fechaCurso, $fechaActual) !== 0){ ?>
							<div class="inactivo"><img src="http://www.eadeconsulting.com/wp-content/themes/neweade/images/bolsa.png" alt="Curso de Bolsa" width="830" height="186" /></div>
							<?php;}
						else{?>
							<div class="activo"><a href="<?php echo $curso['guid'];?>"><img src="http://www.eadeconsulting.com/wp-content/themes/neweade/images/bolsa.png" alt="Curso de Bolsa" width="830" height="186" /></a></div>
						<?php }
						break;
				case 5:if (strcmp($fechaCurso, $fechaActual) !== 0){ ?>
							<div class="inactivo"><img src="http://www.eadeconsulting.com/wp-content/themes/neweade/images/protocolo.png" alt="Curso de Protocolo" width="830" height="186" /></div>
							<?php;}
						else{?>
							<div class="activo"><a href="<?php echo $curso['guid'];?>"><img src="http://www.eadeconsulting.com/wp-content/themes/neweade/images/protocolo.png" alt="Curso de Protocolo" width="830" height="186" /></a></div>
						<?php }
						break;
				case 6: if (strcmp($fechaCurso, $fechaActual) !== 0){ ?>
							<div class="inactivo"><img src="http://www.eadeconsulting.com/wp-content/themes/neweade/images/liderazgo.png" alt="Curso de Liderazgo" width="830" height="186" /></div>
							<?php;}
						else{?>
							<div class="activo"><a href="<?php echo $curso['guid'];?>"><img src="http://www.eadeconsulting.com/wp-content/themes/neweade/images/liderazgo.png" alt="Curso de Liderazgo" width="830" height="186" /></a></div>
						<?php }
						break;
				case 7:if (strcmp($fechaCurso, $fechaActual) !== 0){ ?>
							<div class="inactivo"><img src="http://www.eadeconsulting.com/wp-content/themes/neweade/images/mk.png" alt="Curso de Marketing" width="830" height="186" /></div>
							<?php;}
						else{?>
							<div class="activo"><a href="<?php echo $curso['guid'];?>"><img src="http://www.eadeconsulting.com/wp-content/themes/neweade/images/mk.png" alt="Curso de Marketing" width="830" height="186" /></a></div>
						<?php }
						break;
			}
		}
	}
}